xl: Fix CHK_ERRNO()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 10 Dec 2013 15:45:17 +0000 (15:45 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 18 Dec 2013 11:09:48 +0000 (11:09 +0000)
commit54984ac03af709ce122d53c5a1936a2fecc15625
tree4629da961e1cccaa0f42b556b3e1b7b75f927c55
parenta0070f7a5ad8652c74c685a0ee5f10215402279d
xl: Fix CHK_ERRNO()

The macro CHK_ERRNO() was being used to check two different error schemes, and
succeeded at neither.

Split the macro into two; CHK_SYSCALL() for calls which return -1 and set
errno on error, and CHK_ERRNOVAL() for calls which return an errno.

In both cases, ensure that strerror() now gets called with the error integer.

Coverity ID: 1055570 1090374 1130516

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
tools/libxl/xl_cmdimpl.c